1 <?php
2 session_start();
3 include(
"header.php");
4 include(
"sidebar.php");
5
6 include(
"dbconnection.php");
7 if
(isset($_GET["ordid"]))
8 {
9 $dt= date(
"Y-m-d");
10 mysql_query(
"UPDATE sparepartsorder SET status='Delivered',deliverydate='$dt' where sporderid='$_GET[ordid]'");
11 }

12
13 if
(isset($_SESSION[custid]))
14 {
15     $result= mysql_query(
"select * from sparepartsorder where custid='$_SESSION[custid]'");
16 }

17 else

18 {
19     $result= mysql_query(
"select * from sparepartsorder");
20 }
21 ?>
22         
23                             
24         <div id=
"main">
25             
26             <a name=
"TemplateInfo"></a>
27             <h1>View purchased Vehicles</h1>
28          
29 <form id=
"form1" name="form1" method="post" action="">
30           <table width=
"657" border="1">
31             <tr>
32               <th width=
"67" scope="col">Order ID</th>
33               <th width=
"221" scope="col">Spare Parts details</th>
34               <th width=
"138" scope="col">Customer<br />
35               details</th>
36               <th width=
"81" scope="col">Date</th>
37               <th width=
"45" scope="col">No. of Items</th>
38               
39               <th width=
"46" scope="col">Status</th>
40               
41             </tr>
42           <?php
43           
while($arrrec= mysql_fetch_array($result))
44           {
45 $result1= mysql_query(
"select * from vehiclestore where vehicleid='$arrrec[vehicleid]'");
46 $arrrec1= mysql_fetch_array($result1);
47
48 $result2= mysql_query(
"select * from spareparts where spid='$arrrec[spid]'");
49 $arrrec2= mysql_fetch_array($result2);
50
51 $result3= mysql_query(
"select * from customer where custid='$arrrec[custid]'");
52 $arrrec3= mysql_fetch_array($result3);
53            echo
" <tr>
54               <td>&nbsp; $arrrec[sporderid]</td>
55               <td><img src='upload/$arrrec2[image]' height='
75' width='75' align='left'>
56               Name: <b>$arrrec2[name]</b><br>
57               Type: <b>$arrrec2[type]</b><br>
58               Cost: Dhs. <b>$arrrec2[cost]</b><br>
59               Spareparts No: <b>$arrrec2[sparepartno]</b><br>
60               </td>
61                <td>&nbsp;"
;
62                echo
"<strong>Name: </strong>".$arrrec3[fname]. " ". $arrrec3[lname]."<br>";
63                echo
"<strong>Contact No.: </strong>". $arrrec3[contactno1];
64              echo
" </td>
65               <td>&nbsp;<strong>Order date:</strong> <br>&nbsp;$arrrec[orderdate]&nbsp;<hr>
66               &nbsp;<strong>Delivered date:</strong> <br>&nbsp;$arrrec[deliverydate]</td>
67               <td>&nbsp; $arrrec[noofitems]</td>
68               <td>&nbsp; <strong>$arrrec[status]</strong><br>"
;
69               
if(!isset($_SESSION[custid]))
70               {
71               
if($arrrec[status] == "Pending")
72               {
73 echo
"<a href='viewbuyspareparts.php?ordid=$arrrec[sporderid]'>Delivered</a>";
74               }
75               }
76               echo
"</td></tr>";
77           }
78           ?>
79           </table>
80       </form>
81             <p>&nbsp;</p>
82 <br />
83                                             
84         </div>
85         
86 <!-- wrap ends here -->
87 </div>
88         
89 <?php
90 include(
"footer.php");
91 ?>


Gõ tìm kiếm nhanh...